package com.liang.pojo;

import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Data
@Component
public class User {

    @Value("1001")
    private Integer id;
    @Value("romeo")
    private String username;
    @Autowired
    @Qualifier("car")
//    @Resource(name = "carr")
    private Car car;

    public void init(){
        System.out.println("init...");
    }

    public void destroy(){
        System.out.println("destroy...");
    }
}
